<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include/taglibs.jsp"%>
<script type="text/javascript">

$(document).ready(function(){
	<c:if test="${param.returnCode=='0000' }">
	alert('저장되었습니다.');
	</c:if>
	<c:if test="${param.returnCode=='0001' }">
	alert('중복된 아이디가 있습니다.');
	</c:if>
});

//데이터 저장
function submitData(){

}

//캠핑삭제
function deleteData(no){
	if(confirm("삭제하시겠습니까? 관련 데이터는 모두 삭제되고 복구가 불가능합니다.")){
		location.href="./peti101T.do?p_id="+no;
	}
}


//사용자 페이지 보여주기
function showUser(p_id){
	$.popUrl("/usr/pe/re/petc1001Q.do?p_id="+p_id,"1200","730","userInfo");
// 	
}
function showUser1(p_id){
	$.popUrl("/usr/pe/re/pere700Q.do?p_id="+p_id,"1200","730","userInfo");
// 	
}
function showUser2(p_id){
	$.popUrl("/usr/pe/re/pere1200Q.do?p_id="+p_id,"1200","730","userInfo");
// 	
}
</script>

	<table width="900" border="0" cellspacing="1" cellpadding="2"
		class="class_admin_table_nocolor">
		<tr>
			<td height="25" width="350"><font color="brown">캠핑관리 ▶
					캠핑목록</font></td>
			<td height="25" width="450" align="left">&nbsp;
			<td align="right">&nbsp;</td>
			</td>
		</tr>
	</table>
	<br>

	<table width="900" border="0" cellspacing="1" cellpadding="2">
		<form name="search" action="/admin/index.php?menu=pension">
			<input type="hidden" name="menu" value=pension> <input
				type="hidden" name="mode" value="list">
			<tr>
				<td align="left">검색 <select name="type">
						<option value="p_name">
							이름</a>
						<option value="p_id">
							아이디</a>
				</select> <script>
					var str = "";
					if (str.length >= 1)
						document.search.type.value = ""
				</script> <input name="key" value="" size="20"> <input type=submit
					value="찾기">
				</td>

				<td align="right"><a href="./peti200Q.do">[캠핑생성]</a></td>
			</tr>
		</form>
	</table>
	<table width="900" border="0" cellspacing="1" cellpadding="2"
		class="class_admin_table">
		<tr height="25" class="class_admin_table_head">
			<td align="center" width="100">캠핑아이디</td>
			<td align="center" width="150">캠핑명</td>
			<td align="center">예약정보</td>
			<td align="center" width="150">홈페이지</td>
			<td align="center" width="30">사이트정보</td>
			<td align="center" width="30">그룹정보</td>
			<td align="center" width="80">SMS 잔여건수</td>
			<td align="center" width="100">관리</td>
			<td align="center" width="50">등록일1</td>
			<td align="center" width="50">등록일2</td>
		</tr>
<c:if test="${list !=null && fn:length(list)>0 }">
	<c:forEach var="map" items="${list}" varStatus="status">
		<tr height="25" class="class_admin_table_blank">
			<td align="center"><a href="./peti300Q.do?p_id=${map.p_id }">${map.p_id }</a></td>
			<td align="left"><a href="./peti300Q.do?p_id=${map.p_id}">${map.p_nm }</a></td>
			<td align="center">
				<a href="#" onclick="showUser('${map.p_id }');return false;"><font color="#bd3565"><u>[사용자]</u></font></a>&nbsp;
				<a href="#" onclick="showUser1('${map.p_id }');return false;"><font color="#bd3565"><u>[예약정보]</u></font></a>&nbsp;
				<a href="#" onclick="showUser2('${map.p_id }');return false;"><font color="#bd3565"><u>[달력]</u></font></a>
			</td>
			<td align="left"><a href="http://${map.homepage_url }" target="_blank">${map.homepage_url }</a></td>
			<td align="center"><a href="./peti500Q.do?p_id=${map.p_id }">${map.room_cnt }</a></td>
			<td align="center"><a href="./petc0101Q.do?p_id=${map.p_id }">${map.group_cnt }</a></td>
			<td align="center">${map.sms_cnt }</td>
			
			<td align="center">
				<input type=button class=btn onclick="deleteData('${map.p_id}');" value='삭제'>
			</td>
			<td align="center">${map.reg_dt1 }</td>
			<td align="center">${map.reg_dt2 }</td>
		</tr>
	</c:forEach>
</c:if>
	</table>

	<br>
	${pageHtml }

